home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / winsock / winftp.zip / WNFTPSRC.ZIP / WINICMP.H < prev    next >
C/C++ Source or Header  |  1993-12-10  |  4KB  |  101 lines

  1. #ifndef IP_ICMPHEADER
  2.  
  3. #define IP_ICMPHEADER
  4.  
  5. typedef struct icmp {
  6.        BYTE icmp_type;
  7.        BYTE icmp_code;
  8.        WORD icmp_cksum;
  9.        WORD icmp_id;
  10.        WORD icmp_seq;
  11.        char icmp_data[1];
  12. } ICMP, *LPICMP;
  13.  
  14. typedef struct ip {
  15.        BYTE    ip_hl:4,                /* header length */
  16.                ip_v:4;                 /* version */
  17.        BYTE    ip_tos;                 /* type of service */
  18.        short   ip_len;                 /* total length */
  19.        u_short ip_id;                  /* identification */
  20.        short   ip_off;                 /* fragment offset field */
  21.        BYTE    ip_ttl;                 /* time to live */
  22.        BYTE    ip_p;                   /* protocol */
  23.        u_short ip_sum;                 /* checksum */
  24.        struct  in_addr ip_src, ip_dst; /* source and dest address */
  25. } IPSTRUCT, *LPIPSTRUCT;
  26.  
  27. #define   SIZE_ICMP_HDR              8
  28. #define   SIZE_TIME_DATA             8
  29.  
  30. #define   WM_PING_HOST           WM_USER+1
  31. #define   WM_PING_PROTO          WM_USER+2
  32. #define   WM_PING_CAS            WM_USER+3
  33. #define   WM_PING_RECEIVE        WM_USER+4
  34. #define   WM_PING_FINISH         WM_USER+5
  35. #define   WM_RESETCURSOR         WM_USER+10
  36.  
  37. #define   ICMP_ECHOREPLY             0   /* echo reply */
  38. #define   ICMP_UNREACH               3   /* dest unreachable, codes: */
  39. #define   ICMP_UNREACH_NET           0   /* bad net */
  40. #define   ICMP_UNREACH_HOST          1   /* bad host */
  41. #define   ICMP_UNREACH_PROTOCOL      2   /* bad protocol */
  42. #define   ICMP_UNREACH_PORT          3   /* bad port */
  43. #define   ICMP_UNREACH_NEEDFRAG      4   /* IP_DF caused drop */
  44. #define   ICMP_UNREACH_SRCFAIL       5   /* src route failed */
  45. #define   ICMP_SOURCEQUENCH          4   /* packet lost, slow down */
  46. #define   ICMP_REDIRECT              5   /* shorter route, codes: */
  47. #define   ICMP_REDIRECT_NET          0   /* for network */
  48. #define   ICMP_REDIRECT_HOST         1   /* for host */
  49. #define   ICMP_REDIRECT_TOSNET       2   /* for tos and net */
  50. #define   ICMP_REDIRECT_TOSHOST      3   /* for tos and host */
  51. #define   ICMP_ECHO                  8   /* echo service */
  52. #define   ICMP_TIMXCEED             11   /* time exceeded, code: */
  53. #define   ICMP_PARAMPROB            12   /* ip header bad */
  54. #define   ICMP_TSTAMP               13   /* timestamp request */
  55. #define   ICMP_TSTAMPREPLY          14   /* timestamp reply */
  56. #define   ICMP_IREQ                 15   /* information request */
  57. #define   ICMP_IREQREPLY            16   /* information reply */
  58. #define   ICMP_MASKREQ              17   /* address mask request */
  59. #define   ICMP_MASKREPLY            18   /* address mask reply */
  60.  
  61. #define   ICMP_TIMXCEED_INTRANS      0   /* ttl==0 in transit */
  62. #define   ICMP_TIMXCEED_REASS        1   /* ttl==0 in reass */
  63.  
  64. #define ICMP_MAXTYPE                18
  65.  
  66. #define ICMP_MINLEN     8                               /* abs minimum */
  67. #define ICMP_TSLEN      (8 + 3 * sizeof (n_time))       /* timestamp */
  68. #define ICMP_MASKLEN    12                              /* address mask */
  69. #define ICMP_ADVLENMIN  (8 + sizeof (struct ip) + 8)    /* min */
  70. #define ICMP_ADVLEN(p)  (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
  71.  
  72. #define STNORM          0
  73.  
  74. /* Definition of the lowest telnet byte following an IAC byte */
  75.  
  76. #define LOW_TEL_OPT 236
  77.  
  78. #define TEL_EOF     236
  79. #define SUSP        237
  80. #define ABORT       238
  81.  
  82. #define SE          240
  83. #define NOP         241
  84. #define DM          242
  85. #define BREAK       243
  86. #define IP          244
  87. #define AO          245
  88. #define AYT         246
  89. #define EC          247
  90. #define EL          248
  91. #define GOAHEAD     249
  92. #define SB          250
  93. #define WILL        251
  94. #define WONT        252
  95. #define DO          253
  96. #define DONT        254
  97. #define IAC         255
  98.  
  99. #endif
  100.  
  101.